package origin.database;

import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.dbcp.BasicDataSource;

public class ConnectionManager {
	private static ConnectionManager instance = null;
	
	private IConnectionPool pool = null;
	
	private ConnectionManager(){
		pool = ConnectionPoolFactory.getInstance().getDefaultConnectionPool();
	}
	
	public static synchronized ConnectionManager getInstance(){
		if(instance==null)
			instance = new ConnectionManager();
		return instance;
	}
	
	public synchronized Connection getConnection()throws SQLException{
		return pool.getConnection();
	}
}
